/* $Header: aux_tbls.c,v 2.2 01/10/02 10:29:11 przybyls Exp $ */

/* pneu_tbls.c - workfile get/set for pneu setpoints */
/* wikfors; sometime in late 1992 */
/* Copyright (c) 1992, Hewlett-Packard Co. */

#include <typedefs.h>
#include <pcb_defs.h>
#include <error.h>
#include <p_wkfile.h>
#include <p_status.h>
#include <zone_config.h>
#include <method.h>
#include <p_ui.h>
#include <clock_ui.h>
#include <exception.h>
#include <err_handler.h>
#include <meth_config.h>

#define METH_RATE     METH_INT2
#define METH_PRES     METH_INT0
#define METH_FLOW     METH_INT0
#define METH_TIME     METH_INT2
#define METH_NUM      METH_INT0
#define METH_TEMP     METH_INT0
#define METH_ZONE_ERR METH_INT0

/* function prototypes */
UI_ERR NullFunc(void *which);

void TurnInterruptsON ( void );
void TurnInterruptsOFF ( void );

UI_ERR LockPneuWkfile   ( void *which );
UI_ERR UnlockPneuWkfile ( void *which );

static INT32  mGetAuxPresState    ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxWkfileState  ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxInitPres     ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxInitTime     ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxPresRate     ( void *status, U_INT8 ramp_num    );
static INT32  mGetAuxFinalPres    ( void *status, U_INT8 ramp_num    );
static INT32  mGetAuxFinalTime    ( void *status, U_INT8 ramp_num    );
static INT32  mGetAuxPresSetpt    ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxPresActual   ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxGasType      ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxPresEquibTime( void *status, U_INT8 unused_parm );
static INT32  mGetAuxPresRange    ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxCalPresZero  ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxCalPresValue ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxCalState     ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxCalDate      ( void *status, U_INT8 unused_parm );
static INT32  mGetAuxCalOffset    ( void *status, U_INT8 which_aux   );
static INT32  mGetAuxCalPres      ( void *status, U_INT8 which_aux   );
static INT32  mGetAuxCalPresGain  ( void *status, U_INT8 which_aux   );
static INT32  mGetAuxType         ( void *status, U_INT8 which_aux   );

static INT32  mGetAuxFactoryCalPresZero  ( void *status, U_INT8 unused_parm );

static UI_ERR mSetAuxPresState    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxCalState     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxInitPres     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxInitTime     ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxPresRate     ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetAuxFinalPres    ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetAuxFinalTime    ( void *status, INT32 setpt, U_INT8 ramp_num    );
static UI_ERR mSetAuxPresSetpt    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxGasType      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxPresEquibTime( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxCalPresZero  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mSetAuxCalPresValue ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mSetAuxFactoryCalPresZero  ( void *status, INT32 setpt, U_INT8 unused_parm );

static UI_ERR mLetAuxType         ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetAuxPresRange    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetAuxGasType      ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR mLetAuxPresEquibTime( void *status, INT32 setpt, U_INT8 unused_parm );


typedef INT32  (* const GET)(void *status, U_INT8 unused_parm);
typedef UI_ERR (* const SET)(void *status, INT32 setpt, U_INT8 unused_parm);

UI_ERR A3LockPneuWkfile   ( void *which )
{
    if ( DoingMethodInstall() )
    {
         if ( TestForException ( AUX_3_TYPE  )  ||
              TestForException ( AUX_3_RANGE ))
         {
              return NOT_ALLOWED;
         }
    }

    (void)LockPneuWkfile( which );
    return OK;
}

UI_ERR A4LockPneuWkfile   ( void *which )
{
    if ( DoingMethodInstall() )
    {
         if ( TestForException ( AUX_4_TYPE  )  ||
              TestForException ( AUX_4_RANGE ))
         {
              return NOT_ALLOWED;
         }
    }

    (void)LockPneuWkfile( which );
    return OK;
}

UI_ERR A5LockPneuWkfile   ( void *which )
{
    if ( DoingMethodInstall() )
    {
         if ( TestForException ( AUX_5_TYPE  )  ||
              TestForException ( AUX_5_RANGE ))
         {
              return NOT_ALLOWED;
         }
    }

    (void)LockPneuWkfile( which );
    return OK;
}




static const METHCMD_ENTRY mmXXLS[] =
{
      { mGetAuxCalState,     (SET)NullFunc,       0,  METH_NUM  },
      { mGetAuxCalDate,      (SET)NullFunc,       0,  METH_NUM  },
      { mGetAuxCalOffset,    (SET)NullFunc,       3,  METH_PRES },
      { mGetAuxCalPres,      (SET)NullFunc,       3,  METH_PRES },
      { mGetAuxCalPresGain,  (SET)NullFunc,       3,  METH_INT2 },
      { mGetAuxCalOffset,    (SET)NullFunc,       4,  METH_PRES },
      { mGetAuxCalPres,      (SET)NullFunc,       4,  METH_PRES },
      { mGetAuxCalPresGain,  (SET)NullFunc,       4,  METH_INT2 },
      { mGetAuxCalOffset,    (SET)NullFunc,       5,  METH_PRES },
      { mGetAuxCalPres,      (SET)NullFunc,       5,  METH_PRES },
      { mGetAuxCalPresGain,  (SET)NullFunc,       5,  METH_INT2 } 
     
};


const METHCMD mAXLS =
{
        MAXINDEX(mmXXLS, METHCMD_ENTRY),
        &mmXXLS[0],
        (void *)&Inst_Status.Pneu.Aux,
        LockPneuWkfile,
        UnlockPneuWkfile
};




static const METHCMD_ENTRY mmXXLX[] =
{
      { mGetAuxCalState,     mSetAuxCalState,       0,  METH_NUM  }
     
};


const METHCMD mAXLX =
{
        MAXINDEX(mmXXLX, METHCMD_ENTRY),
        &mmXXLX[0],
        (void *)&Inst_Status.Pneu.Aux,
        LockPneuWkfile,
        UnlockPneuWkfile
};





static const METHCMD_ENTRY mmXXFZ[] =
{
      { mGetAuxFactoryCalPresZero,  mSetAuxFactoryCalPresZero,  3,  METH_PRES },
      { mGetAuxFactoryCalPresZero,  (SET)NullFunc,              4,  METH_PRES },
      { mGetAuxFactoryCalPresZero,  (SET)NullFunc,              5,  METH_PRES }
};


const METHCMD mAXFZ =
{
        MAXINDEX(mmXXFZ, METHCMD_ENTRY),
        &mmXXFZ[0],
        (void *)&Inst_Status.Pneu.Aux,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXPZ[] =
{
      { mGetAuxCalPresZero,  mSetAuxCalPresZero,  0,  METH_PRES }
};


const METHCMD mA3PZ =
{
        MAXINDEX(mmXXPZ, METHCMD_ENTRY),
        &mmXXPZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4PZ =
{
        MAXINDEX(mmXXPZ, METHCMD_ENTRY),
        &mmXXPZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5PZ =
{
        MAXINDEX(mmXXPZ, METHCMD_ENTRY),
        &mmXXPZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXPV[] =
{
      { mGetAuxCalPresValue,  mSetAuxCalPresValue,      0,  METH_PRES }
};


const METHCMD mA3PV =
{
        MAXINDEX(mmXXPV, METHCMD_ENTRY),
        &mmXXPV[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4PV =
{
        MAXINDEX(mmXXPV, METHCMD_ENTRY),
        &mmXXPV[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5PV =
{
        MAXINDEX(mmXXPV, METHCMD_ENTRY),
        &mmXXPV[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};




static const METHCMD_ENTRY mmXXCF[] =
{
      { mGetAuxGasType,      mSetAuxGasType,      0,  METH_NUM  },
      { mGetAuxPresEquibTime,mSetAuxPresEquibTime,0,  METH_TIME },
      { mGetAuxPresRange,    (SET)NullFunc,       0,  METH_PRES }
};


const METHCMD mA3CF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4CF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5CF =
{
        MAXINDEX(mmXXCF, METHCMD_ENTRY),
        &mmXXCF[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};




static const METHCMD_ENTRY mmXXCW[] =
{
      { mGetAuxType,         mLetAuxType,         0,  METH_PRES },
      { mGetAuxPresRange,    mLetAuxPresRange,    0,  METH_PRES },
      { mGetAuxGasType,      mLetAuxGasType,      0,  METH_NUM  },
      { mGetAuxPresEquibTime,mLetAuxPresEquibTime,0,  METH_TIME } 
};


const METHCMD mA3CW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4CW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5CW =
{
        MAXINDEX(mmXXCW, METHCMD_ENTRY),
        &mmXXCW[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXST[] =
{
      { mGetAuxPresState,    (SET)NullFunc,       0,  METH_NUM  },
      { mGetAuxPresSetpt,    (SET)NullFunc,       0,  METH_PRES },
      { mGetAuxPresActual,   (SET)NullFunc,       0,  METH_PRES } 
};


const METHCMD mA3ST =
{
        MAXINDEX(mmXXST, METHCMD_ENTRY),
        &mmXXST[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4ST =
{
        MAXINDEX(mmXXST, METHCMD_ENTRY),
        &mmXXST[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5ST =
{
        MAXINDEX(mmXXST, METHCMD_ENTRY),
        &mmXXST[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXPI[] =
{
      { mGetAuxPresSetpt,  mSetAuxPresSetpt,  0,  METH_PRES } 
};


const METHCMD mA3PI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA4PI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        LockPneuWkfile,
        UnlockPneuWkfile
};



const METHCMD mA5PI =
{
        MAXINDEX(mmXXPI, METHCMD_ENTRY),
        &mmXXPI[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXPR[] =
{
      { mGetAuxInitPres,   mSetAuxInitPres,   0,  METH_PRES },
      { mGetAuxInitTime,   mSetAuxInitTime,   0,  METH_TIME },
      { mGetAuxPresRate,   mSetAuxPresRate,   1,  METH_PRES },
      { mGetAuxFinalPres,  mSetAuxFinalPres,  1,  METH_PRES },
      { mGetAuxFinalTime,  mSetAuxFinalTime,  1,  METH_TIME },
      { mGetAuxPresRate,   mSetAuxPresRate,   2,  METH_PRES },
      { mGetAuxFinalPres,  mSetAuxFinalPres,  2,  METH_PRES },
      { mGetAuxFinalTime,  mSetAuxFinalTime,  2,  METH_TIME },
      { mGetAuxPresRate,   mSetAuxPresRate,   3,  METH_PRES },
      { mGetAuxFinalPres,  mSetAuxFinalPres,  3,  METH_PRES },
      { mGetAuxFinalTime,  mSetAuxFinalTime,  3,  METH_TIME } 
};


const METHCMD mA3PR =
{
        MAXINDEX(mmXXPR, METHCMD_ENTRY),
        &mmXXPR[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        A3LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mA4PR =
{
        MAXINDEX(mmXXPR, METHCMD_ENTRY),
        &mmXXPR[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        A4LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mA5PR =
{
        MAXINDEX(mmXXPR, METHCMD_ENTRY),
        &mmXXPR[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        A5LockPneuWkfile,
        UnlockPneuWkfile
};



static const METHCMD_ENTRY mmXXNZ[] =
{
      { mGetAuxWkfileState,mSetAuxPresState,  0,  METH_PRES },
};


const METHCMD mA3NZ =
{
        MAXINDEX(mmXXNZ, METHCMD_ENTRY),
        &mmXXNZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_3,
        A3LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mA4NZ =
{
        MAXINDEX(mmXXNZ, METHCMD_ENTRY),
        &mmXXNZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_4,
        A4LockPneuWkfile,
        UnlockPneuWkfile
};


const METHCMD mA5NZ =
{
        MAXINDEX(mmXXNZ, METHCMD_ENTRY),
        &mmXXNZ[0],
        (void *)&Inst_Status.Pneu.Aux.Aux_5,
        A5LockPneuWkfile,
        UnlockPneuWkfile
};


static INT32 mGetAuxPresState ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return (INT32)GetAuxState( (pAUX_STATUS)status );
}

static INT32 mGetAuxWkfileState ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return (INT32)GetAuxWkfileState( (pAUX_STATUS)status );
}


static INT32 mGetAuxInitTime ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;
      return GetAuxPresInitTime( (pAUX_STATUS)status );
}


static INT32 mGetAuxInitPres ( void *status, U_INT8 unused_parm )
{
      (void) unused_parm;

/*------------changed by wangwei--------------------*/
        mLog("call mGetAuxInitPres\n");
/*--------------end change--------------------------*/
      return DcGetAuxInitPres( (pAUX_STATUS) status );
}


static INT32 mGetAuxPresRate ( void *status, U_INT8 ramp_num )
{
      return DcGetAuxPresRate( (pAUX_STATUS)status, ramp_num );
}

static INT32 mGetAuxFinalPres ( void *status, U_INT8 ramp_num )
{
      return DcGetAuxPresFinalVal( (pAUX_STATUS) status, ramp_num );
}

static INT32 mGetAuxFinalTime ( void *status, U_INT8 ramp_num )
{
      return GetAuxPresFinalTime( (pAUX_STATUS)status, ramp_num );
}

static INT32 mGetAuxPresSetpt ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return DcGetAuxPresSetpt( (pAUX_STATUS)status );
}

static INT32 mGetAuxPresActual ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return DcGetAuxPresActual( (pAUX_STATUS)status );
}

static INT32 mGetAuxGasType    ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return (INT32)GetAuxGasType ( (pAUX_STATUS)status );
}

static INT32 mGetAuxPresEquibTime ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return GetAuxPresEquibTime( (pAUX_STATUS)status );
}

static INT32 mGetAuxPresRange  ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return DcGetAuxMaxPres( (pAUX_STATUS)status );
}

static INT32 mGetAuxCalPresZero( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return DcGetAuxCalPresZero( (pAUX_STATUS)status );
}

static INT32 mGetAuxFactoryCalPresZero( void *status, U_INT8 unused_parm )
{
      switch ( unused_parm )

      { case 3: return DcGetAuxCalPresZero( (pAUX_STATUS)(&(((pAUXILIARY_STATUS)status)->Aux_3)) );
        case 4: return DcGetAuxCalPresZero( (pAUX_STATUS)(&(((pAUXILIARY_STATUS)status)->Aux_4)) );
        case 5: return DcGetAuxCalPresZero( (pAUX_STATUS)(&(((pAUXILIARY_STATUS)status)->Aux_5)) );
      }

      return 0;
}

static INT32 mGetAuxCalPresValue  ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;
      return DcGetAuxCalPresValue( (pAUX_STATUS)status );
}

static INT32 mGetAuxCalDate  ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;

      return (INT32)SecondsSince1980( GetAuxCalibDate ( (pAUX_STATUS)status ) );
}

static INT32 mGetAuxCalState ( void *status, U_INT8 unused_parm )
{
      (void)unused_parm;

      return (INT32)AuxUserCalibState( (pAUX_STATUS)status );
}



static INT32  mGetAuxCalOffset    ( void *status, U_INT8 which_aux   )
{
      switch( which_aux )
      {
          case 3: return DcGetAuxCalPresZero ( &((pAUXILIARY_STATUS)status)->Aux_3 );
          case 4: return DcGetAuxCalPresZero ( &((pAUXILIARY_STATUS)status)->Aux_4 );
	  default:
          case 5: return DcGetAuxCalPresZero ( &((pAUXILIARY_STATUS)status)->Aux_5 );
      }
}

static INT32  mGetAuxCalPresGain  ( void *status, U_INT8 which_aux   )
{
      switch( which_aux )
      {
          case 3: return DcGetAuxCalPresGain ( &((pAUXILIARY_STATUS)status)->Aux_3 );
          case 4: return DcGetAuxCalPresGain ( &((pAUXILIARY_STATUS)status)->Aux_4 );
	  default:
          case 5: return DcGetAuxCalPresGain ( &((pAUXILIARY_STATUS)status)->Aux_5 );
      }
}

static INT32  mGetAuxCalPres      ( void *status, U_INT8 which_aux   )
{
      switch( which_aux )
      {
          case 3: return DcGetAuxCalPresValue ( &((pAUXILIARY_STATUS)status)->Aux_3 );
          case 4: return DcGetAuxCalPresValue ( &((pAUXILIARY_STATUS)status)->Aux_4 );
	  default:
          case 5: return DcGetAuxCalPresValue ( &((pAUXILIARY_STATUS)status)->Aux_5 );
      }
}











static UI_ERR mSetAuxPresRate ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      return DcSetAuxPresRate( (pAUX_STATUS)status, setpt, ramp_num );
}


static UI_ERR mSetAuxInitTime ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetAuxPresInitTime( (pAUX_STATUS)status, setpt );
}



static UI_ERR mSetAuxInitPres ( void *status, INT32 setpt, U_INT8 unused_parm )
{
      (void) unused_parm;
      return DcSetAuxInitPres( (pAUX_STATUS)status, setpt );
}

static UI_ERR mSetAuxFinalTime ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      return DcSetAuxPresFinalTime( (pAUX_STATUS)status, setpt, ramp_num );
}



static UI_ERR mSetAuxFinalPres ( void *status, INT32 setpt, U_INT8 ramp_num )
{
      return DcSetAuxPresFinalVal( (pAUX_STATUS)status, setpt, ramp_num );
}



static UI_ERR mSetAuxPresState      ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;
       return  SetAuxState( (ON_OFF)setpt, (pAUX_STATUS)status );
}



static UI_ERR mSetAuxCalState       ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

        switch ( setpt )
        {
            case FACTORY:       return DcDeleteAuxCalib ( status );
            case USER_ENABLED:  return DcTurnOnAuxCalib ( status );
            case USER_DISABLED: return DcTurnOffAuxCalib ( status );
        }

        return INVALID_PARAM;
}



static UI_ERR mSetAuxPresSetpt      ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;

       return  DcSetAuxPresSetpt( setpt, (pAUX_STATUS)status );

}
static UI_ERR mSetAuxGasType        ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;

       return  SetAuxGasType  ( (GAS_TYPE)setpt, (pAUX_STATUS)status );
}

static UI_ERR mSetAuxPresEquibTime  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;

       return  DcSetAuxPresEquibTime( setpt, (pAUX_STATUS)status );
}

static UI_ERR mSetAuxFactoryCalPresZero  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;
       (void) setpt;
       (void) status;

       return  DcSetAuxFactoryCalPresZero(  );
}

static UI_ERR mSetAuxCalPresZero  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;
       (void) setpt;

       return  DcSetAuxCalPresZero( (pAUX_STATUS)status );
}

static UI_ERR mSetAuxCalPresValue  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
       (void) unused_parm;

       return  DcSetAuxCalPres( (pAUX_STATUS)status, setpt );
}



static INT32  mGetAuxType         ( void *status, U_INT8 unused      )
{
   (void) unused;
   (void) status;

    return (INT32)PneuAuxPresent ( );

}

#define pneu_status ((pAUX_STATUS)status)

static UI_ERR mLetAuxType         ( void *status, INT32 setpt, U_INT8 unused_parm )
{
    (void)unused_parm;
    gccw.PneuAuxType [ (pneu_status->Position == AUX_3 ) ? 0 : 
                       (pneu_status->Position == AUX_4 ) ? 1 : 2 ] = setpt;
    return OK;
}

static UI_ERR mLetAuxPresRange    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
    (void)unused_parm;
    gccw.AuxPSensorRange [ (pneu_status->Position == AUX_3 ) ? 0 : 
                           (pneu_status->Position == AUX_4 ) ? 1 : 2 ] = setpt;
    return OK;
}

static UI_ERR mLetAuxGasType      ( void *status, INT32 setpt, U_INT8 unused_parm )
{
    (void)unused_parm;
    gccw.AuxGasType [ (pneu_status->Position == AUX_3 ) ? 0 : 
                      (pneu_status->Position == AUX_4 ) ? 1 : 2 ] = (GAS_TYPE)setpt;
    return OK;
}

static UI_ERR mLetAuxPresEquibTime( void *status, INT32 setpt, U_INT8 unused_parm )
{
    (void)unused_parm;
    gccw.AuxPresEquibTime [ (pneu_status->Position == AUX_3 ) ? 0 : 
                            (pneu_status->Position == AUX_4 ) ? 1 : 2 ] = setpt;
    return OK;
}

